Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Ensure fieldmap is resampled correctly in report #3387

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

effigies
Copy link
Member

While attempting to reproduce a bug report, I ran across a crash. Fieldmaps are always in RAS, while the BOLD references and masks are in the space of the original BOLD. In the case of ds000221, that's LSP. The reportlet assumes all input images are in the same space, and so can fail if the field-of-view is not a cube (and would be bad otherwise).

I was unable to reproduce the reported bug, but it's possible it was confused for this. For searchability's sake, the error was:

2024-10-21 12:21:37,963 [CRITICAL] fMRIPrep failed: Traceback (most recent call last):
  File "/home/chris/mambaforge/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/mambaforge/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/mambaforge/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/mambaforge/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node sdecreg_report.

Traceback:
        Traceback (most recent call last):
          File "/home/chris/mambaforge/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 398, in run
            runtime = self._post_run_hook(runtime)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/home/chris/mambaforge/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/mixins/reporting.py", line 50, in _post_run_hook
            self._generate_report()
          File "/home/chris/Projects/nipreps/sdcflows/sdcflows/interfaces/reportlets.py", line 103, in _generate_report
            abs(np.percentile(fmapdata[maskdata], 99.8)),
                              ~~~~~~~~^^^^^^^^^^
        IndexError: boolean index did not match indexed array along dimension 1; dimension is 88 but corresponding boolean dimension is 64

I'm calling this a bug-fix because the workflow change occurred in a non-critical path (reports) and there is no risk of pollution from an existing working directory.

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.78%. Comparing base (1248b63) to head (c4014f2).
Report is 4 commits behind head on maint/24.1.x.

Additional details and impacted files
@@               Coverage Diff                @@
##           maint/24.1.x    #3387      +/-   ##
================================================
- Coverage         71.79%   71.78%   -0.02%     
================================================
  Files                57       57              
  Lines              4255     4256       +1     
  Branches            459      458       -1     
================================================
  Hits               3055     3055              
  Misses             1086     1086              
- Partials            114      115       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mgxd mgxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - opened nipreps/sdcflows#467 to either catch or address this in the reportlet

@effigies effigies merged commit 0218f4f into nipreps:maint/24.1.x Oct 24, 2024
14 of 16 checks passed
@effigies effigies deleted the fix/sdcreg_report branch October 24, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants